﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace XNA_3DFramWork
{
    public class Camera:GameObject
    {
        public Camera(Game game) : base(game)
        {
            SetCamera();
        }

        public  override void Draw()
        {
            
        }

        public  override void Update()
        {
            
        }
        private void SetCamera()
        {
            Matrix = Matrix.CreateLookAt(new Vector3(0, 0, -10), new Vector3(0, 0, 10), Vector3.Up);
            BEffect.View = Matrix;
            BEffect.Projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4, this.Game.GraphicsDevice.Viewport.AspectRatio, 1.0f, 300.0f);
        }
    }
}
